﻿// ===============================================================================
// XCI.WinForm.Platform 西安交通信息WinForm开发框架 2019 版权所有
// ===============================================================================

namespace XCI.Core
{
    public class EditModel<T> where T : class
    {
        public bool Created { get; set; }
        public T Model { get; set; }

        /// <summary>
        ///   初始化 <see cref="T:System.Object" /> 类的新实例。
        /// </summary>
        public EditModel()
        {
        }

        /// <summary>
        ///   初始化 <see cref="T:System.Object" /> 类的新实例。
        /// </summary>
        public EditModel(bool created,T model)
        {
            Created = created;
            Model = model;
        }

        public static EditModel<T> Create(T model)
        {
            return new EditModel<T>(true, model);
        }

        public EditModel<T> Edit(T model)
        {
            return new EditModel<T>(false, model);
        }
    }
}